package com.suncaper.tddmall.controller;

import com.suncaper.tddmall.common.model.Goods;
import com.suncaper.tddmall.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class PageController {

    @Autowired
    GoodsService goodsService;

    @GetMapping("/simple_product")
    public String toSimple_product(String goodsId, Model model){
        Goods goods = goodsService.selectByPrimaryKey(goodsId);
        model.addAttribute("goods",goods);
        return "../static/page/simple_product";

    }
}
